﻿using System;
using System.Collections.Generic;
using System.Text;

namespace VerticalSpider.IDaos
{
    public interface IBaseRepository<T>
        where T : class
    {
        /// <summary>
        /// 增加一条数据
        /// </summary>
        /// <param name="id"></param>
        /// <param name="Model"></param>
        void Add(string id, T Model);

        /// <summary>
        /// 删除数据
        /// </summary>
        /// <param name="id"></param>
        void Delete(string id);

        /// <summary>
        /// 更新数据
        /// </summary>
        /// <param name="id"></param>
        /// <param name="model"></param>
        void Update(string id, T model);

        /// <summary>
        /// 获取数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        T Get(string id);

        /// <summary>
        /// 获取全部数据
        /// </summary>
        /// <returns></returns>
        IEnumerable<string> GetAllIds();
    }
}
